package com.careercup.question.id5548094871568384;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Solution {
	/**
	 * Given an array, return true, if it can be partitioned into two sub arrays whose sum of elements are same, else return false
	 * Example: 
	 * Input: {5, 1, 5, 11}
	 * Output: true (as it can be divided into {5, 1, 5} {11} where 5 + 1 + 5 = 11)
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		List<Integer> l = new ArrayList<Integer>();
		while(in.hasNext())
			l.add(in.nextInt());
		int p1 = 0, p2 = l.size() - 1, s1 = 0, s2 = 0;
		while(p1 <= p2) {
			while(p1 <= p2 && s1 <= s2)
				s1 += l.get(p1++);
			while(p1 <= p2 && s1 >= s2)
				s2 += l.get(p2--);
		}
		if(s1 == s2)
			System.out.println("true");
		else
			System.out.println("false");
	}
}
